package fr.ece.ing4.si.gui;

import java.awt.Scrollbar;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

public class MainWindow extends JFrame {

	/* Attributes for the creation of the menu */
	
	private JMenuBar menuBar = new JMenuBar();
	
	private JMenu file = new JMenu("File");
	private JMenu parameters = new JMenu("Parameters");
	
	private JMenuItem quit = new JMenuItem("Quit");
	/*private JMenuItem CallPutFlagItem = new JMenuItem("CallPutFlag");
	private JMenuItem SItem = new JMenuItem("S");
	private JMenuItem XItem = new JMenuItem("X");
	private JMenuItem rItem = new JMenuItem("r");
	private JMenuItem TItem = new JMenuItem("T");
	private JMenuItem bItem = new JMenuItem("b");
	private JMenuItem vItem = new JMenuItem("v");
	private JMenuItem nStepsItem = new JMenuItem("nSteps");
	private JMenuItem nSimulationsItem = new JMenuItem("nSimulations");*/
	
	
	/* Overloaded constructor */
	
	public MainWindow(MainPanel mainPanel) {
		
		super();
		
		setContentPane(mainPanel);
		
	}
	
	
	public void configureWindow() {
		
		setTitle("Monte Carlo Application");
		setSize(1100, 750);
		setLocationRelativeTo(null);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setResizable(false);
		setVisible(true);
		
	}
	
	
	public void configureMenu() {
		
		/* Creation of the menu */
		
		file.add(quit);
		
		menuBar.add(file);
		menuBar.add(parameters);
		
		setJMenuBar(menuBar);

		
		/* Actions */
		
		quit.addActionListener(new ActionListener() {
	
			@Override
			public void actionPerformed(ActionEvent arg0) {
				
				System.exit(0);
				
			}
			
		});
	
	}
	
}
